<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <!-- 全屏 -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 上方栏显示 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 不自动识别号码 -->
    <meta name="format-detection" content="telephone=no">
    <!-- Include js plugin -->
    <title><{if $type == 3}>作业记录<{else if $type == 4}>我的记录<{/if}></title>
    <link rel="stylesheet" href="/static/wap/skin/css/layout.css">
    <link rel="stylesheet" href="/static/wap/skin/css/demos.css">
</head>
<body>
<header class="brB">
    <div class="h_top">
        <div class="hLeft"><a href="/" class="icoH icoReturn mt20"></a></div>
        <div class="hCenter"><span class="tit c-3ac9af"><{if $type == 3}>作业记录<{else if $type == 4}>我的记录<{/if}></span></div>
    </div>
</header>
<div class="warp">
    <div class="fix b-FFFFFF" id="layui_flow">
        <table class="layui-table" lay-even lay-skin="row">
            <thead>
                <tr>
                    <th>学员</th>
                    <th>成绩</th>
                    <th>交卷时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <{foreach from=$history_list item=item}>
                <tr>
                    <td class="tal not_lb"><{$item.name}></td>
                    <td class="tal not_lb"><{$item.fraction}></td>
                    <td class="tal not_lb">
                    <{if $item.status == 1}>
                    <{$item.end_time|date_format: '%Y-%m-%d <br/> %H:%M'}>
                    <{else}>
                    未交卷
                    <{/if}>
                    </td>
                    <td class="tal not_lb">
                        <div class="colorBtn">
                            <p><a class="c-3283fa" href="/my/classes/show_volume/<{$item.id}>/<{$conditions.type}>">查看答卷</a></p>
                        </div>
                    </td>
                </tr>
            <{/foreach}>
        </table>
    </div>
</div>
<script src="/static/public/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/static/wap/weui/js/jquery.min.js"></script>
<script src="/static/wap/weui/js/jquery-weui.min.js"></script>
<script src="/static/wap/skin/js/demos.js"></script>
<link href="/static/public/layer/src/css/layui.css" rel="stylesheet">
<script src="/static/public/layer/src/layui.js"></script>
<script>
$.fn.Dashenselect("#select_ify",".box-col",".citytit",".citybox","i","s","a","click","curr","hover","selected");
layui.use('flow', function(){
    var flow = layui.flow;
    flow.load({
        elem: '#layui_flow' //流加载容器
        ,isAuto:false
        ,scrollElem: '#layui_flow' //滚动条所在元素，一般不用填，此处只是演示需要。
        ,done: function(page, next){ //执行下一页的回调
            //模拟数据插入
            setTimeout(function(){
                var lis = [];
                if(page > 1){
                    $.ajax({
                        type: "GET",
                        url: "/my/classes/volume_historys/<{$conditions.home_work_id}>/<{$conditions.type}>/<{$conditions.name}>/"+page,
                        dataType:"json",
                        success: function(result){
                            if(result){
                                $.each(result,function(i, n){
                                    if(n.status == 1){
                                        var time = n.end_time;
                                    }else{
                                        var time = '未交卷';
                                    }
                                    var html = '<tr>';
                                    html += '<td class="tal not_lb">'+n.name+'</td>';
                                    html += '<td class="tal not_lb">'+n.fraction+'</td>';
                                    html += '<td class="tal not_lb">'+time+'</td>';
                                    html += '<td class="tal not_lb">';
                                    html += '<div class="colorBtn">';
                                    html += '<p><a class="c-3283fa" href="/my/classes/show_volume/'+n.id+'/<{$conditions.type}>">查看答卷</a></p>';
                                    html += '</div>';
                                    html += '</td>';
                                    html += '</tr>';
                                    $("#layui_flow").find("tr:last").after(html)
                                    // console.log(html)
                                });

                            }
                        }
                    });
                }
                
            //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
            //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
                next(lis.join(''), page < "<{$count-1}>"); //假设总页数为 10
            }, 500);
        }
    });
});
</script>
</body>
</html>